﻿@model FieldControlViewModel
@{
	var itemList = string.Empty;
	var selectList = StringHelper.GetArrayBySplit<string>(Model.Settings[0], "$$$");
	selectList.ForEach(item =>
	{
		itemList += "<a style=\"color:red;\" href=\"javascript:AppendStringToControl('"+ item + "','"+ Model.Prefix + Model.FieldName + "');\">【" + item+ "】</a>";
	});
	string dataVal = string.Empty;
	string dataValMsg = string.Empty;
	if (Model.EnableNull)
	{
		dataVal += " data-val-required=\"不能为空\" ";
	}
	if (!string.IsNullOrEmpty(dataVal))
	{
		dataVal += " data-val=\"true\" ";
		dataValMsg = " data-valmsg-for=\"" + Model.Prefix + Model.FieldName + "\" data-valmsg-replace=\"true\"";
	}
}

<input type="text" class="layui-input" name="@Model.Prefix@Model.FieldName" id="@Model.Prefix@Model.FieldName" value="@Model.FieldValue" @Html.Raw(dataVal) />
<span style="color:red;" @Html.Raw(dataValMsg)></span>
<span>选项：@Html.Raw(itemList)</span>
<span class="layui-bg-green">@Model.Description</span>
